import Vue from 'vue'
import Router from 'vue-router'
import Index from '../views/index.vue'
import Login from '../views/login.vue'
import user from '../views/user/user.vue'
import news from '../views/news/news.vue'
import addNews from '../views/news/addNews.vue'
import work from '../views/work/work.vue'
import member from '../views/member/member.vue'
import addWork from '../views/work/addWork.vue'
Vue.use(Router)

const router = new Router({
  // mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login,
      hidden: true,
      meta: {
          requireAuth: false
      }
    },
    {
      path: '/login',
      name: '登录',
      component: Login,
      hidden: true,
      meta: {
          requireAuth: false
      }
    },
    {
      path: '/index',
      name: '首页',
      component: Index,
      iconCls: 'el-icon-tickets',
      children:[
      {
        path: '/user/user',
        name: '用户管理',
        component: user,
        meta: {
            requireAuth: true
        }
      },
      {
        path: '/news/news/',
        name: '新闻管理',
        component: news,
        meta: {
            requireAuth: true
        },

      },
      {
        path: '/news/addNews/',
        name: '新闻编辑',
        component: addNews,
        meta: {
            requireAuth: true
        }
      },
      {
        path: '/work/work/',
        name: '作品显示',
        component: work,
        meta: {
            requireAuth: true
        }
      },
      {
        path: '/work/addWork/',
        name: '作品编辑',
        component: addWork,
        meta: {
            requireAuth: true
        }
      },
      {
        path: '/member/member/',
        name: '成员显示',
        component: member,
        meta: {
            requireAuth: true
        }
      },

      ]
    }
  ]
})
  
export default  router
  


